feat: offline-first PWA mobile companion for field incident capture#324
Open
utkarshqz wants to merge 5 commits intofireform-core:mainfrom
Open
feat: offline-first PWA mobile companion for field incident capture#324utkarshqz wants to merge 5 commits intofireform-core:mainfrom
utkarshqz wants to merge 5 commits intofireform-core:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Speak once at the scene. Pick up the PDF at the station.
FireForm fills forms. This PR takes it to where incidents actually happen.
First responders work in basements, forests, and remote areas — no WiFi, sometimes no cellular. The current interface requires a constant station connection, making it unusable in the field. Officers capture on paper, return to the station, and re-enter everything manually. That is exactly the redundant work FireForm was built to eliminate.
This PR adds a minimal Progressive Web App at
/mobile— served by the existing FastAPI server, installable on any phone via "Add to Home Screen", and fully functional offline. No app store. No native code. No new infrastructure.Closes #323
The Field Scenario
What Was Built
Three new files:
mobile/index.html— Complete PWA with three tabs:CAPTURE — Live clock with date, auto-generated incident ID (INC-2026-0321-4821 format), GPS capture via device satellite GPS (works fully offline), voice recording with timer, text notes textarea, media capture placeholder marked as proposed future feature.
DRAFTS — All saved reports with PENDING/SYNCED status. Shows text preview and audio indicator. Edit with additional audio recordings — multiple recordings per draft, all transcribed and combined. Play back recorded audio. Send to station with template selector. PDF download buttons appear only after generation. Delete. Clear offline/online status indicator.
SUBMIT — Template multi-select, text pre-loaded from draft, audio playback, single or batch fill, per-template download links.
mobile/manifest.json— Web App Manifest for installable PWA behavior.mobile/sw.js— Service Worker with aggressive caching:One modified file:
api/main.py— mountsmobile/as StaticFiles at/mobile. Two lines added.Audio + Text Combination
Offline Behaviour
On HTTPS and ngrok
Microphone and Geolocation require HTTPS — a browser security standard, not a FireForm limitation. For production deployment, a self-signed SSL certificate on the station PC resolves this permanently. For demo and testing, ngrok provides an HTTPS tunnel to the local FastAPI server:
ngrok is used only because it provides valid HTTPS for testing on physical devices. In real deployment, officers connect via station WiFi. All data stays on-premise — critical for CJIS compliance.
Proposed Future Extensions
The disabled media capture section shows the intended roadmap:
Type of change
How Has This Been Tested?
Test Configuration:
Checklist: